/*
 * @Author: 陈德基
 * @Date: 2021-11-15 14:13:40
 * @LastEditTime: 2021-11-16 14:08:22
 * @Description: 
 * @FilePath: \copy_gsy_github_app_flutter\lib\page\welcome\widgets\welcome.dart
 * 联系方式：
 * wx: melody_2009
 * qq: 7815171323 
 */
import 'package:copy_gsy_github_app_flutter/common/style/gsy_style.dart';
import 'package:copy_gsy_github_app_flutter/routes/app_pages.dart';
import 'package:flare_flutter/flare_actor.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';

import '../index.dart';
import 'diff_scale_text.dart';

/// hello
class HelloWidget extends GetView<WelcomeController> {
  const HelloWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    double size = 200;
    return Material(
      child: new Container(
        color: APPColors.white,
        child: Stack(
          children: <Widget>[
            new Center(
              child:
                  new Image(image: new AssetImage('static/images/welcome.png')),
            ),
            Align(
              alignment: Alignment(0.0, 0.3),
              child: Obx(() => DiffScaleText(
                    text: controller.state.title,
                    textStyle: GoogleFonts.akronim().copyWith(
                      color: APPColors.primaryDarkValue,
                      fontSize: controller.state.fontsize,
                    ),
                  )),
            ),
            // Align(
            //   alignment: Alignment(0.0, 0.8),
            //   child: Mole(),
            // ),
            new Align(
              alignment: Alignment.bottomCenter,
              child: new Container(
                width: size,
                height: size,
                child: new FlareActor(
                  "static/file/flare_flutter_logo_.flr",
                  alignment: Alignment.topCenter,
                  fit: BoxFit.fill,
                  animation: "Placeholder",
                  callback: (name) {
                    // 进入到主页去
                    controller.loginOrMain();
                  },
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
